package ooday02;
/** 测试类 */
public class Test {
    public static void main(String[] args) {

       Dog[] dogs = new Dog[3];
       dogs[0] = new Dog("小黑",3,"黑");
        dogs[1] = new Dog("小灰",2,"灰");
        dogs[2] = new Dog("小白",1,"白");
        for (int i = 0;i < dogs.length;i++){
            dogs[i].swim();
            dogs[i].eat();
            dogs[i].lookHome();
            System.out.println(dogs[i].name);
        }
        Chick[] chicks = new Chick[2];
        chicks[0] = new Chick("小鸡仔",1,"黄");
        chicks[1] = new Chick("白鸡仔",2,"白");
        for (int i = 0;i < chicks.length;i++){
            chicks[i].eat();
            chicks[i].drink();
            System.out.println(chicks[i].name);
        }
        Fish[] fish = new Fish[2];
        fish[0] = new Fish("金鱼",1,"金");
        fish[1] = new Fish("金龙鱼",2,"红");
        for (int i = 0;i < fish.length;i++){
            fish[i].eat();
            fish[i].drink();
            System.out.println(fish[i].name);
        }
    }
}




















